using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using YooAsset;

public class MJ_LayoutConfigManager : GameLogic.Singleton<MJ_LayoutConfigManager>
{
    public MJ_TableLayoutConfig tableLayoutConfig;

    public void InitTableLayoutConfig()
    {
        //加载Json配置,转成MJ_TableLayoutConfig对象
        var jsonConfig =  YooAssets.LoadAssetSync<TextAsset>("MJ_TableLayoutConfig");
        if(jsonConfig == null){
            Debug.LogError("MJ_TableLayoutConfig 配置文件加载失败");
            return;
        }
        tableLayoutConfig = JsonUtility.FromJson<MJ_TableLayoutConfig>((jsonConfig.AssetObject as TextAsset).text);
    }


    public MJ_TableLayoutConfig GetTableLayoutConfig(){
        if(tableLayoutConfig == null){
            InitTableLayoutConfig();
        }
        return tableLayoutConfig;
    }
}
